package com.lzy.cloud.order.service.impl;

import com.lzy.cloud.order.dtos.OrderAssessContentDto;
import com.lzy.cloud.order.entity.OrderAssess;
import com.lzy.cloud.order.entity.OrderAssessContent;
import com.lzy.cloud.order.mapper.OrderAssessContentMapperExt;
import com.lzy.cloud.order.service.OrderAssessContentService;
import com.lzy.framework.core.utils.DozerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description:订单评论内容
 * @author: liyun
 * @create: 2018-07-06 16:20
 */
@Service
public class OrderAssessContentServiceImpl implements OrderAssessContentService {
    @Autowired
    private OrderAssessContentMapperExt orderAssessContentMapperExt;

    @Override
    public List<OrderAssessContentDto> queryListByAssessId(Long assessId) {
        return orderAssessContentMapperExt.queryListByAssessId(assessId);
    }

    @Override
    public Long create(OrderAssessContentDto orderAssessContentDto) {
        OrderAssessContent orderAssessContent = DozerUtils.map(orderAssessContentDto, OrderAssessContent.class);
        return orderAssessContentMapperExt.insertSelective(orderAssessContent)>0 ? orderAssessContent.getId() : 0;
    }
}
